// need to write a function to check whether the calendar is empty now
#pragma once
#ifndef FEEDBACK_H
#define FEEDBACK_H
#include<vector>
#include<sstream> 
#include<string>
#include"Event.h" 

//@author A0105735J
enum Error{
	ErrorConfuse, ErrorWrongTime, ErrorNotFound , ErrorUndo, ErrorFormat
};

//@author A0105735J
enum Succed{
	SucceedAdd, SucceedDelete, SucceedUpdate, SuccedRead, SucceedSearch, SucceedDisplay, SucceedMark, SucceedStatus, SucceedUndo
};

//@author A0105735J
const std::string SUCCEED_ADD =  "Execution succeeds, the event has been added\n";
const std::string SUCCEED_DEL =  "Execution succeeds, the event has been deleted\n";
const std::string SUCCEED_UPDATE =  "Execution succeeds, the event has been updated\n";
const std::string SUCCEED_READ =  "Execution succeeds, the calendar has been read\n";
const std::string SUCCEED_SEARCH =  "Execution succeeds, the event has been found\n";
const std::string SUCCEED_MARK =  "Execution succeeds, the event has been marked\n";
const std::string SUCCEED_DISPLAY =  "Execution succeeds, the event has been displayed\n";
const std::string SUCCEED_STATUS = "Execution succeeds, the event's status has been updated\n";
const std::string SUCCEED_UNDO = "Execution succeeds, undo the last available command\n";
const std::string ERROR_CONFUSE = "Execution fails, parser is confused about what is the time and date, please use t[ ] to mark the location of time and date. e.g t[12:00 tmr] \n";
const std::string ERROR_ERRORTIME = "Execution fails, date or time is invalid\n";
const std::string ERROR_NOTFOUND = "Execution fails, target is not found\n";
const std::string ERROR_UNDO = "Execution fails, no available commands to undo\n";
const std::string ERROR_FORMAT = "Execution fails, instruction is invalid\n";

class Feedback{
private: 
	bool _isValid;
	std::vector<Event*> _events;
	EventType outputType;
	std::string _fbCommand;

	Error errorType;
	Succed succeedType;


public:

	//@author A0080451N
	bool getIsValid();
	//@author A0080451N
	void setIsValid(bool result);
	
	//@author A0105735J
	std::string writeOutExecutionFb();
	
	//@author A0080451N
	void storeUpdateCalendar(std::vector<Event*>);
	//@author A0080451N
	std::vector<Event*> getUpdateCalendar();

	//@author A0105735J
	void setErrorType(Error);
	//@author A0105735J
	void setSucceedType(Succed);
	//@author A0080451N
	std::vector<Event*> getEventVector();
	//@author A0080451N
	Error Feedback::getErrorType();
	//@author A0080451N
	std::vector<Event*> getEventOnDateClicked(int, int, int);

};
#endif
